﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using NHibernate.Criterion;

namespace Inference
{
    [ActiveRecord]
    class Log:ActiveRecordBase<Log> 
    {
        private int slot;
        private int val;
        private bool reason;

        [PrimaryKey]
        public  int ValueID
        {
            get { return val; }
            protected set { val = value; }
        }

        [Property]
        public  int SlotID
        {
            get { return slot; }
            set { slot = value; }
        }

        [Property]
        public  bool Reason
        {
            get { return reason; }
            set { reason = value; }
        }

        public Log()
        {
        }

        public Log(int _SlotID, int _ValueID, bool _Reason)
        {
            val = _ValueID;
            reason = _Reason;
            slot = _SlotID;
        }

        public static Log Find(int id)
        {
            return (Log)FindByPrimaryKey(typeof(Log), id);
        }

        public static Log FindByName(string name)
        {

            return FindFirst((typeof(Log)), Expression.Eq("Name", name)) as Log;
        }


    }
}
